#!/usr/bin/env ruby1.9
# encoding: UTF-8

require 'term/ansicolor'

require './lib/hindo.rb'

describe Words, "save to file" do

    it "Uses a default of data.txt" do
	settings = mock "Settings"
	word_filter = mock "WordFilter"

	settings.should_receive(:use_kana).and_return false
	settings.should_receive(:words_file).and_return NIL

	Words.new(settings, word_filter).file_name.should == 'data.txt'
    end

    it "Uses a value from settings" do
	settings = mock "Settings"
	word_filter = mock "WordFilter"

	settings.should_receive(:use_kana).and_return false
	settings.should_receive(:words_file).twice.and_return "a different file.txt"

	Words.new(settings, word_filter).file_name.should == 'a different file.txt'
    end


end
